﻿function Validate() {
    
    var obj_txtFirstName = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtFirstName_I');
    var obj_txtLastName = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtLastName_I');
    var obj_txtEmailID = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtEmailID_I');
    var obj_txtMobileNo = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtMobileNo_I');
    var obj_txtAddress1 = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtAddress1_I');
    var obj_txtAddress2 = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtAddress2_I');
    var obj_txtCity = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtCity_I');
    var obj_txtPostCode = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtPostCode_I');
    var obj_cmbArea = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_cmbArea_I');

    if (obj_txtFirstName.value == "") {
        alert('Kindly Specify First Name.')
        obj_txtFirstName.focus();
        return false;
    }
    if (obj_txtLastName.value == "") {
        alert('Kindly Specify Last Name.')
        obj_txtLastName.focus();
        return false;
    }
    
    var obj = obj_txtEmailID;
    var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;

    if (obj_txtEmailID.value != "") {
        if (regex.test(obj.value)) {

        }
        else {
            alert('Please Enter Valid Email ID.')
            obj_txtEmailID.focus()
            return false;
        }
    }

    if (obj_txtMobileNo.value == "") {
        alert('Kindly Specify Mobile No.')
        obj_txtMobileNo.focus();
        return false;
    }
    if (obj_txtAddress1.value == "") {
        alert('Kindly Specify Address 1.')
        obj_txtAddress1.focus();
        return false;
    }
    if (obj_txtCity.value == "") {
        alert('Kindly Specify City.')
        obj_txtCity.focus();
        return false;
    }
    if (obj_txtPostCode.value == "") {
        alert('Kindly Specify Post Code.')
        obj_txtPostCode.focus();
        return false;
    }

    var r = confirm("Are you sure ??? ");
    if (r) {
    }
    else {
        return false
    }

    return true;
}